#@layout()
#define main()
<h1>图书管理&nbsp;&nbsp;
    #if(session.loginUser.identity == 1)
        <a href="/books/add">创建图书</a>
    #end
</h1>
#include("_search.html")
<div class="table_box">
    <table class="list">
        <tbody>
        <tr>
            <th width="4%" style="text-align:center;">id</th>
            <th width="10%" style="text-align:center;">图书编号</th>
            <th width="35%" style="text-align:center;">图书名称</th>
            <th width="10%" style="text-align:center;">作者</th>
            <th width="15%" style="text-align:center;">出版社</th>
            <th width="35%" style="text-align:center;">操作</th>
        </tr>

        #for(x : bookPage.getList())
        <tr>
            <td style="text-align:center;">#(x.id)</td>
            <td style="text-align:center;">#(x.bookno)</td>
            <td style="text-align:center;">#(x.bookname)</td>
            <td style="text-align:center;">#(x.author)</td>
            <td style="text-align:center;">#(x.publisher)</td>
            <td style="text-align:center;">
                #if(session.loginUser.identity == 1)
                &nbsp;&nbsp;<a href="/books/delete/#(x.id)">删除</a>
                &nbsp;&nbsp;<a href="/books/edit/#(x.id)">修改</a>
                #end
                &nbsp;&nbsp;<a href="/books/borrow/#(x.id)">借书</a>
            </td>
        </tr>
        #end
        </tbody>
    </table>
    #@paginate(bookPage.pageNumber, bookPage.totalPage, "/books/")
</div>
#end